/* ==========================================================================
   Worskpace Manager Styles
   ========================================================================== */

.workspace-manager-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  overflow: hidden;
  animation: fadeIn 0.2s ease-out; /* Fade in animation */
  background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
  backdrop-filter: blur(2px); /* Slight blur effect for depth */
  transition: opacity 0.2s ease; /* Smooth transition when closing */
}

.workspace-manager {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
  width: 500px;
  max-width: 90%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dark-mode .workspace-manager {
  background-color: #1e1e1e;
  border: 1px solid #333;
}

.workspace-manager-header {
  padding: var(--space-md) var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
}

.dark-mode .workspace-manager-header {
  border-bottom: 1px solid #333;
}

.workspace-manager-header h2 {
  margin: 0;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
}

.workspace-manager-header .close-button {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.workspace-manager-header .close-button:hover,
.workspace-manager-header .close-button:focus-visible {
  color: var(--text-primary);
  background: none;
  box-shadow: none;
}

.workspace-manager-content {
  padding: 16px;
  flex: 1;
  overflow-y: auto;
  max-height: 70vh;
}

.new-workspace-form {
  display: flex;
  margin-bottom: 16px;
  gap: 8px;
}

.new-workspace-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.dark-mode .new-workspace-input {
  background-color: #333;
  border-color: #444;
  color: #fff;
}

.new-workspace-button {
  padding: 8px 12px;
  background-color: var(--color-primary);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
}

.new-workspace-button:hover {
  background-color: var(--color-primary);
}

.new-workspace-button:disabled {
  color: var(--text-primary);
  background-color: #93c5fd;
  cursor: not-allowed;
}

.workspaces-list {
  margin-top: 8px;
}

.workspaces-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.workspace-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border: 1px solid #eee;
  border-radius: 4px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dark-mode .workspace-item {
  border-color: #333;
}

.workspace-item:hover {
  background-color: #f3f4f6;
}

.dark-mode .workspace-item:hover {
  background-color: #2a2a2a;
}

.workspace-item.active {
  background-color: #bfdbfe;
}

.dark-mode .workspace-item.active {
  background-color: #1e293b;
}

.workspace-info {
  flex: 1;
  overflow: hidden;
}

.workspace-name {
  font-weight: 500;
  margin-bottom: 4px;
  color: #333;
}

.dark-mode .workspace-name {
  color: #fff;
}

.workspace-path {
  font-size: 12px;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.dark-mode .workspace-path {
  color: #aaa;
}

.workspace-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.set-folder-button,
.clear-folder-button,
.delete-workspace-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 4px;
  border: 1px solid #ccc;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  margin-left: 5px;
  width: 32px;
  height: 32px;
}

.set-folder-button {
  background-color: #e0f2fe;
  border-color: #bae6fd;
  color: #0c4a6e;
}

.clear-folder-button {
  background-color: #fff7e6;
  border-color: #ffd591;
  color: #fa8c16;
}

.delete-workspace-button {
  background-color: #fff1f0;
  border-color: #ffa39e;
  color: #f5222d;
}

.set-folder-button:hover {
  background-color: #bfdbfe;
  border-color: #93c5fd;
  color: #073352;
}

.clear-folder-button:hover {
  background-color: #ffe7ba;
  border-color: #fa8c16;
  color: #d46b08;
}

.delete-workspace-button:hover {
  background-color: #ffccc7;
  border-color: #f5222d;
  color: #cf1322;
}

.dark-mode .set-folder-button,
.dark-mode .clear-folder-button,
.dark-mode .delete-workspace-button {
  border-color: #333;
}

.dark-mode .set-folder-button {
  background-color: #10243e;
  border-color: #153450;
  color: #40a9ff;
}

.dark-mode .clear-folder-button {
  background-color: #2b2111;
  border-color: #442a15;
  color: #ffa940;
}

.dark-mode .delete-workspace-button {
  background-color: #2a1215;
  border-color: #431418;
  color: #ff7875;
}

.dark-mode .set-folder-button:hover {
  background-color: #15395b;
  border-color: #177ddc;
  color: #69c0ff;
}

.dark-mode .clear-folder-button:hover {
  background-color: #443111;
  border-color: #ad6800;
  color: #ffc069;
}

.dark-mode .delete-workspace-button:hover {
  background-color: #441e20;
  border-color: #a8071a;
  color: #ff9c9c;
}

.no-workspaces {
  text-align: center;
  padding: 16px;
  color: #666;
  font-style: italic;
}

.dark-mode .no-workspaces {
  color: #aaa;
}

.current-workspace-name {
  margin-left: 8px;
  font-weight: 500;
}

.workspace-button {
  display: flex;
  align-items: center;
  background-color: #f5f5f5;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.dark-mode .workspace-button {
  background-color: #333;
  border-color: #444;
}
